using UnityEditor;
using UnityEngine;
using UnityX;

namespace UnityXEditor
{
    [CanEditMultipleObjects]
    [CustomEditor(typeof(MultipleSelectGroup), true)]
    internal class MultipleSelectGroupEditor : Editor
    {
        private SerializedProperty m_NormalImageSprite;
        private SerializedProperty m_SelectedImageSprite;
        private SerializedProperty m_NormalImageTexture;
        private SerializedProperty m_SelectedImageTexture;
        private SerializedProperty m_NormalImageColor;
        private SerializedProperty m_SelectedImageColor;
        private SerializedProperty m_NormalTextColor;
        private SerializedProperty m_SelectedTextColor;

        private SerializedProperty m_Selectds;

        protected void OnEnable()
        {
            m_NormalImageSprite = serializedObject.FindProperty("m_NormalImageSprite");
            m_SelectedImageSprite = serializedObject.FindProperty("m_SelectedImageSprite");
            m_NormalImageTexture = serializedObject.FindProperty("m_NormalImageTexture");
            m_SelectedImageTexture = serializedObject.FindProperty("m_SelectedImageTexture");
            m_NormalImageColor = serializedObject.FindProperty("m_NormalImageColor");
            m_SelectedImageColor = serializedObject.FindProperty("m_SelectedImageColor");
            m_NormalTextColor = serializedObject.FindProperty("m_NormalTextColor");
            m_SelectedTextColor = serializedObject.FindProperty("m_SelectedTextColor");

            m_Selectds = serializedObject.FindProperty("m_Selectds");
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.PropertyField(m_NormalImageSprite, new GUIContent("NormalImageSprite"));
            EditorGUILayout.PropertyField(m_NormalImageTexture, new GUIContent("NormalImageTexture"));
            EditorGUILayout.PropertyField(m_NormalImageColor, new GUIContent("NormalImageColor"));
            EditorGUILayout.PropertyField(m_NormalTextColor, new GUIContent("NormalTextColor"));

            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(m_SelectedImageSprite, new GUIContent("SelectedImageSprite"));
            EditorGUILayout.PropertyField(m_SelectedImageTexture, new GUIContent("SelectedImageTexture"));
            EditorGUILayout.PropertyField(m_SelectedImageColor, new GUIContent("SelectedImageColor"));
            EditorGUILayout.PropertyField(m_SelectedTextColor, new GUIContent("SelectedTextColor"));

            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(m_Selectds, new GUIContent("选中"));

            serializedObject.ApplyModifiedProperties();
        }
    }
}